import request from '@/utils/request'

export function list(page, size) {
  return request({
    url: '/apiMenus/list',
    method: 'post',
    data: {
      page,
      size
    }
  })
}

export function getAllList(has_child = 0) {
  return request({
    url: '/apiMenus/getAllList',
    method: 'post',
    data: {
      has_child
    }
  })
}

export function addOrEditMenu(data) {
  return request({
    url: '/apiMenus/addOrEditMenu',
    method: 'post',
    data
  })
}

export function delMenu(id) {
  return request({
    url: '/apiMenus/delMenu',
    method: 'post',
    data: {
      menu_id: id
    }
  })
}
